package net.zdreamer.geracomium.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.ImageView;

import com.example.geracomium.R;

import net.zdreamer.geracomium.entity.PhotoInfos;
import net.zdreamer.geracomium.entity.PhotoInfos.PhotoInfo;
import net.zdreamer.geracomium.utils.tools_utils.ViewHolder;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Admin on 2014/12/16.
 */
public class ImageAdapter extends MyBaseAdapter<PhotoInfo> {
    private Context context;
    private int item;
    private List<PhotoInfo> list;

    public ImageAdapter(Context context, List<PhotoInfo> list, int res, int item) {
        super(context, list, res);
        this.context = context;
        this.item = item;
        this.list = list;
    }

    @Override
    protected View getView(int position, View convertView, ViewGroup parent, PhotoInfos.PhotoInfo value) {
       // position = item;
        ImageView imageView = new ImageView(context);
        imageView.setImageResource((int) value.imageURL.get(position).get("photo"));
        imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
        imageView.setLayoutParams(new Gallery.LayoutParams(
                Gallery.LayoutParams.FILL_PARENT,
                Gallery.LayoutParams.FILL_PARENT));
        System.out.println("------------加载---" + position);
        return imageView;
    }


}
